From 9115dabec871b7acf240ebd6c098ebbdb51f7334 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 26 Nov 2005 22:47:37 +0000 Subject: [PATCH] * Internal reworking of code * Use $wgContLang->lc() rather than strtolower() --- includes/Exif.php | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/includes/Exif.php b/includes/Exif.php index b2b43c1491..d6bb13846e 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -81,14 +81,28 @@ class Exif { var $mFormattedExifData; /**#@-*/ + + /**#@+ + * @var string + * @access private + */ + + /** + * The file being processed + */ + var $file; + /** + * The basename of the file being processed + */ + var $basename; + /** * The private log to log to - * - * @var string - * @access private */ var $log = 'exif'; + + /**#@-*/ /** * Constructor @@ -281,13 +295,14 @@ class Exif { ), ); - $basename = basename( $file ); + $this->file = $file; + $this->basename = basename( $this->file ); $this->makeFlatExifTags(); - $this->debugFile( $basename, __FUNCTION__, true ); + $this->debugFile( $this->basename, __FUNCTION__, true ); wfSuppressWarnings(); - $data = exif_read_data( $file ); + $data = exif_read_data( $this->file ); wfRestoreWarnings(); /** * exif_read_data() will return false on invalid input, such as @@ -299,7 +314,7 @@ class Exif { $this->makeFilteredData(); $this->makeFormattedData(); - $this->debugFile( $basename, __FUNCTION__, false ); + $this->debugFile( __FUNCTION__, false ); } /**#@+ @@ -567,12 +582,12 @@ class Exif { * @paran string $fname The name of the function calling this function * @param bool $bool $io Specify whether we're beginning or ending */ - function debugFile( $basename, $fname, $io ) { + function debugFile( $fname, $io ) { $class = ucfirst( __CLASS__ ); if ( $io ) - wfDebugLog( $this->log, "$class::$fname: begin processing: '$basename'\n" ); + wfDebugLog( $this->log, "$class::$fname: begin processing: '{$this->basename}'\n" ); else - wfDebugLog( $this->log, "$class::$fname: end processing: '$basename'\n" ); + wfDebugLog( $this->log, "$class::$fname: end processing: '{$this->basename}'\n" ); } } @@ -999,9 +1014,11 @@ class FormatExif { * @return string A wfMsg of "exif-$tag-$val" in lower case */ function msg( $tag, $val, $arg = null ) { + global $wgContLang; + if ($val === '') $val = 'value'; - return wfMsg( strtolower( "exif-$tag-$val" ), $arg ); + return wfMsg( $wgContLang->lc( "exif-$tag-$val" ), $arg ); } /** -- 2.20.1